package thread;

import java.util.Scanner;

public class SleepDemo {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入整数时间:");
        int i = sc.nextInt();
        try {
            for (int j = i; j > 0; j--) {
                System.out.println(j);
                Thread.sleep(1000);
            }

        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println(0);
        System.out.println("时间到");
    }
}
